﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KwaiXiaoDian.Entity.Common
{
    public static class Consts
    {
        /// <summary>
        /// 环境
        /// </summary>
        public static class Environments
        {
            public const string DEV = "DEV";
            public const string TEST = "TEST";
            public const string UAT = "UAT";
            public const string PROD = "PROD";
        }

        /// <summary>
        /// 错误码
        /// </summary>
        public static class ErrorCodes
        {
            /// <summary>
            /// 验证码错误
            /// </summary>
            public const string A0101 = "A0101";

            /// <summary>
            /// 参数错误
            /// </summary>
            public const string A0102 = "A0102";

            /// <summary>
            /// 用户名或密码错误
            /// </summary>
            public const string A0103 = "A0103";

            /// <summary>
            /// 记录不存在
            /// </summary>
            public const string A0404 = "A0404";

            /// <summary>
            /// 系统异常
            /// </summary>
            public const string A0500 = "A0500";

            /// <summary>
            /// 未登录
            /// </summary>
            public const string B0101 = "B0101";

            /// <summary>
            /// 没有权限
            /// </summary>
            public const string B0102 = "B0102";

        }

        /// <summary>
        /// 系统配置
        /// </summary>
        public static class ConfigKeys
        {
            /// <summary>
            /// 最大批次号
            /// </summary>
            public const string MAX_LOT_NO = "MaxLotNo";

            /// <summary>
            /// 网站设置
            /// </summary>
            public const string WEBSITE_CONFIG = "WebSiteConfig";

        }

        /// <summary>
        /// 域名
        /// </summary>
        public static class Domains
        {
            /// <summary>
            /// 快小店api
            /// </summary>
            public const string KwaiXiaoDian = "app.kwaixiaodian.com";

            /// <summary>
            /// Etoote Api
            /// </summary>
            public const string EtooteApi = "ppg.m.etoote.com";


        }

        /// <summary>
        /// 商品列表导出字段
        /// </summary>
        public static class ProductExportFields
        {
            /// <summary>
            /// 创建时间
            /// </summary>
            public const string CreatedTime = "CreatedTime";

            /// <summary>
            /// 团长ID
            /// </summary>
            public const string LeaderId = "LeaderId";

            /// <summary>
            /// 团长名称
            /// </summary>
            public const string LeaderName = "LeaderName";

            /// <summary>
            /// 产品ID
            /// </summary>
            public const string ProductId = "ProductId";

            /// <summary>
            /// 产品名称
            /// </summary>
            public const string ProductName = "ProductName";

            /// <summary>
            /// 商品类别
            /// </summary>
            public const string ChannelName = "ChannelName";

            /// <summary>
            /// 价格
            /// </summary>
            public const string Price = "Price";

            /// <summary>
            /// 利润
            /// </summary>
            public const string ProfitAmount = "ProfitAmount";

            /// <summary>
            /// 佣金率
            /// </summary>
            public const string CommissionRate = "CommissionRate";

            /// <summary>
            /// 商品状态
            /// </summary>
            public const string StatusName = "StatusName";

            /// <summary>
            /// 上架达人数
            /// </summary>
            public const string PromoterNum = "PromoterNum";

            /// <summary>
            /// 月销量(件)
            /// </summary>
            public const string SoldCountThirtyDays = "SoldCountThirtyDays";

            /// <summary>
            /// 图片
            /// </summary>
            public const string ImageUrl = "ImageUrl";


            public static readonly string[] NAMES = { "创建时间", "团长ID", "团长名称", "产品ID", "产品名称", "商品类别", "价格", "利润", "佣金率", "商品状态", "上架达人数", "月销量(件)", "图片" };
            public static readonly string[] VALUES = { CreatedTime, LeaderId, LeaderName, ProductId, ProductName, ChannelName, Price, ProfitAmount, CommissionRate, StatusName, PromoterNum, SoldCountThirtyDays, ImageUrl };

            public static string Name(string val)
            {
                for (int i = 0; i < VALUES.Length; i++)
                {
                    if (VALUES[i] == val)
                    {
                        return NAMES[i];
                    }
                }
                return string.Empty;
            }

            public static string Val(string name)
            {
                for (int i = 0; i < NAMES.Length; i++)
                {
                    if (NAMES[i] == name)
                    {
                        return VALUES[i];
                    }
                }
                return string.Empty;
            }
        }

    }
}
